package com.rq.demo.controller;

import android.os.Bundle;
import android.view.View;

import com.rq.base.ui.BaseController;
import com.rq.base.ui.FragmentContainer;
import com.rq.base.ui.impl.OnClick;
import com.rq.demo.R;

public class FragmentTest extends BaseController implements View.OnClickListener {
    @Override
    public int getLayoutId() {
        return R.layout.act_test_fra;
    }

    FragmentContainer container = new FragmentContainer();

    @Override
    public void onViewCreated(Bundle savedInstanceState) {
        super.onViewCreated(savedInstanceState);
        container.attach(this, R.id.fra_1, Fra1.class);
    }

    int i = 0;

    @Override
    @OnClick({R.id.btn_add_1, R.id.btn_add_2})
    public void onClick(View v) {
        if (v.getId() == R.id.btn_add_1) {
            container.open(Fra2.class, "" + (++i));
        } else if (v.getId() == R.id.btn_add_2) {
            container.open(Fra3.class, "" + (++i));
        }
    }
}
